package com.intellekt.ecertws.ws.vo;

/*
 * This software is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND.
 */
import java.util.ArrayList;
import java.util.Collection;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

public class UserVO implements UserDetails {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1144109196518999881L;
	
	
	private String password;
	private String userName;
	private boolean isAccountNonExpired;
	private boolean isAccountNonLocked;
	private boolean isCredentialsNonExpired;
	private boolean isEnabled;

	public static Collection<GrantedAuthority> authority = new ArrayList<GrantedAuthority>();

	public UserVO() {
	}
	
	public UserVO(String userName, String password, boolean isAccountNonExpired, boolean isAccountNonlocked, boolean isCredentialsNonExpired, boolean isEnabled) {
		this.userName = userName;
		this.password = password;
		this.isAccountNonExpired = isAccountNonExpired;
		this.isAccountNonLocked = isAccountNonlocked;
		this.isCredentialsNonExpired = isCredentialsNonExpired;
		this.isEnabled = isEnabled;
	}

	@Override
	public Collection<GrantedAuthority> getAuthorities() {
		return authority;
	}

	@Override
	public String getPassword() {

		return password;
	}

	@Override
	public String getUsername() {
		return userName;
	}

	@Override
	public boolean isAccountNonExpired() {

		return isAccountNonExpired;
	}

	@Override
	public boolean isAccountNonLocked() {

		return isAccountNonLocked;
	}

	@Override
	public boolean isCredentialsNonExpired() {

		return isCredentialsNonExpired;
	}

	@Override
	public boolean isEnabled() {

		return isEnabled;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public void setAccountNonExpired(boolean isAccountNonExpired) {
		this.isAccountNonExpired = isAccountNonExpired;
	}

	public void setAccountNonLocked(boolean isAccountNonLocked) {
		this.isAccountNonLocked = isAccountNonLocked;
	}

	public void setCredentialsNonExpired(boolean isCredentialsNonExpired) {
		this.isCredentialsNonExpired = isCredentialsNonExpired;
	}

	public void setEnabled(boolean isEnabled) {
		this.isEnabled = isEnabled;
	}

	public static void setAuthority(Collection<GrantedAuthority> authority) {
		UserVO.authority = authority;
	}

}
